Web.config File Example

IT Hit WebDAV Server Engine

The web.config file below is suitable for use in IIS 5.1, 6.0 and IIS 7.0 both in classic and integrated mode:

 

<?xml version="1.0" encoding="utf-8"?>

<configuration>

 

      <!--

         Section for IIS 6 and IIS 5.1. Wildcard map must be configured in IIS.

        

         To allow folders with 'bin', 'App_code', 'App_Data', etc names and files with 'web.config' name

         to be created in your storage, aspnet_filter.dll filter must be removed at server level.

      -->

      <system.web>

           

            <!-- This section also used in IIS 7 classic mode -->

            <httpHandlers>

                  <clear />

                  <add verb="*" path="*" type="WebDAVServer.NtfsStorage.WebDAVHandler, WebDAVServer.NtfsStorage" />

            </httpHandlers>

           

            <!-- This section also used in IIS 7 classic mode -->

            <httpModules>

                  <remove name="FileAuthorization" />

                  <add name="ResumableUploadModule" type="ITHit.WebDAV.Server.ResumableUpload.ResumableUploadModule, ITHit.WebDAV.Server" />

            </httpModules>

 

            <!-- Maximum upload file segment size in Kb, max 2097151 (2Gb) for asp.net -->

            <httpRuntime executionTimeout="2400" maxRequestLength="2097151" />

            <customErrors mode="Off" />

            <authentication mode="None" />

            <authorization>

                  <!-- Allow all users -->

                  <allow users="*" />

            </authorization>

            <globalization requestEncoding="utf-8" responseEncoding="utf-8" />

      </system.web>

 

 

      <!--

         Section for IIS 7. ASP.NET and ISAPI Extensions must be enabled.

         No additional wildcard map configuration is required.

         Edit path to aspnet_isapi.dll below if your application runs in Classic mode.

      -->

      <system.webServer>

            <handlers>

                  <clear />

                  <!-- Used only in Classic mode in 32-bit application -->

                  <add name="aspnet_isapi 32-bit" path="*" verb="*" modules="IsapiModule" scriptProcessor="C:\Windows\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll" resourceType="Unspecified" requireAccess="Script" preCondition="classicMode,runtimeVersionv2.0,bitness32" />

 

                  <!-- Used only in Classic mode in 64-bit application -->

                  <add name="aspnet_isapi 64-bit" path="*" verb="*" modules="IsapiModule" scriptProcessor="C:\Windows\Microsoft.NET\Framework64\v2.0.50727\aspnet_isapi.dll" resourceType="Unspecified" requireAccess="Script" preCondition="classicMode,runtimeVersionv2.0,bitness64" />

                 

                  <!-- Used only in Integrated mode. In classic mode system.web\httpHandlers section is used. -->

                  <add name="My WebDAV Handler" path="*" verb="*" type="WebDAVServer.NtfsStorage.WebDAVHandler, WebDAVServer.NtfsStorage" preCondition="integratedMode,runtimeVersionv2.0" />

            </handlers>

 

            <!-- Used only in Integrated mode. In classic mode system.web\httpModules section is used. -->

            <modules>

                  <remove name="FileAuthorization" />

                  <add name="ResumableUploadModule" type="ITHit.WebDAV.Server.ResumableUpload.ResumableUploadModule, ITHit.WebDAV.Server" />

            </modules>

           

            <validation validateIntegratedModeConfiguration="false" />

 

            <!-- Used in both Integrated and Classic mode -->

            <security>

                  <!-- As all files are stored in a storage there is no need in additional protection. -->

                  <requestFiltering>

 

                        <!-- Allow all files with 'web.config' name. -->

                        <fileExtensions>

                              <clear />

                        </fileExtensions>

 

                        <!-- Allow all folders with 'bin', 'App_code', 'App_Data', etc names. -->                    

                        <hiddenSegments>

                              <clear />

                        </hiddenSegments>

 

                        <!-- Maximum upload file segment size in bytes is 2147483648 (2Gb) for IIS 7 / asp.net. -->

                        <requestLimits maxAllowedContentLength="2147483648"/>

                  </requestFiltering>

            </security>

      </system.webServer>

     

</configuration>